package com.library.controller;

import com.library.common.Result;
import com.library.dto.DashboardVO;
import com.library.service.DashboardService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 仪表盘控制器
 */
@Tag(name = "仪表盘")
@RestController
@RequestMapping("/dashboard")
@RequiredArgsConstructor
public class DashboardController {
    
    private final DashboardService dashboardService;
    
    @Operation(summary = "获取仪表盘数据")
    @GetMapping
    public Result<DashboardVO> getDashboardData() {
        DashboardVO data = dashboardService.getDashboardData();
        return Result.success(data);
    }
}

